<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Skornyakov Anatoliy
 * Date: 01.06.13
 * Time: 14:30
 * 
 */?>

<a href=<?php echo $this->url(array(), 'userAdd') ?>>Дбавить</a>
<br />
Кол-во пользователей: <?php echo $this->userList->count() ?>
<?php if ($this->userList->count() > 0): ?>
    <table border="1">
        <thead>
            <tr>
                <th>Имя</th>
                <th>Фамилия</th>
                <th>Телефон</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->userList as $item): ?>
                <tr>
                    <td><?php echo $item->name ?></td>
                    <td><?php echo $item->surname ?></td>
                    <td>
                        <?php echo implode('-', array($item->phoneCountry, $item->phoneCity, $item->phoneNumber)) ?>
                        <?php if ($item->phoneMore != 0): ?>
                            доб. <?php echo $item->phoneMore ?>
                        <?php endif; ?>
                    </td>
                    <td><a href="<?php echo $this->url(array('userId' => $item->userId), 'userEdit') ?>">Редактировать</a></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
<?php endif; ?>